upstream <%= name %> {
 server 127.0.0.1:5000;
}

server {
  access_log <%= root %>/log/<%= name %>.access.log;
  listen 8080;
  listen [::]:8080;

  root <%= root %>/public;
  server_name <%= name %>.localhost ~^<%= name %>\.localhost\.\d+\.\d+\.\d+\.\d+\.xip\.io$;

  location / {
    proxy_read_timeout 300;
    proxy_connect_timeout   300;
    proxy_redirect off;

    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header X-Frame-Options   SAMEORIGIN;
    proxy_pass http://<%= name %>;
  }
}
